package atomic;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicIntegerTest {

    /*
        public final int getAndAddInt(Object var1, long var2, int var4) {
            int var5;
            do {
                var5 = this.getIntVolatile(var1, var2);
            } while(!this.compareAndSwapInt(var1, var2, var5, var5 + var4));

            return var5;
        }
     */
    public static void main(String[] args) {
        AtomicInteger atomic = new AtomicInteger();

        boolean b1 = atomic.compareAndSet(123, 321);

        int andIncrement = atomic.getAndIncrement();

        int andDecrement = atomic.getAndDecrement();

        int andAdd = atomic.getAndAdd(999);

        boolean b = atomic.weakCompareAndSet(999, 123);
    }
}
